package cc.yugu.yhdw.common.domain.hdw;

import cc.yugu.yhdw.common.domain.IntIdEntity;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 供应商
 */
public class SupplierInfo extends IntIdEntity {

    public enum Type {
        BATTERY(1, "电池"), CABINET(2, "柜子"), POWER(3, "电源");

        private final int value;
        private final String name;

        private Type(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();

        static {
            for (Type e : Type.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    int type;
    String supplierName;
    String tel;
    Integer activeFlag;
    Date createTime;

    public Integer getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(Integer activeFlag) {
        this.activeFlag = activeFlag;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getTypeName() {
        return Type.getName(type);
    }
}
